import {request} from './request'
export function getRightsList(){
  return request({
    method:'get',
    url:'rights/list',
  })
}
export function getRolesList(){
  return request({
    method:"get",
    url:'roles'
  })
}
export function AddRolesReq(data){
  return request({
    method:"post",
    url:'roles',
    data,
  })
}
export function editRoleReq(url){
  return request({
    method:"get",
    url,
  })
}
export function changeRoleInfoReq(url,data){
  return request({
    method:'put',
    url,
    data,
  })
}
export function deleteRoleInfoReq(url){
  return request({
    method:"delete",
    url,
  })
}
export function deleteRoleRightReq(url){
  return request({
    method:'delete',
    url,
  })
}
export function setRightsReq(){
  return request({
    method:'get',
    url:'rights/tree',
  })
}
//角色授权
export function assignRightsReq(url,data){
  return request({
    method:'post',
    url,
    data,
  })
}
//分配用户角色
export function assignUserRoleReq(url,data){
  return request({
    method:'put',
    url,
    data,
  })
}